<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- <meta http-equiv="refresh" content="0;url=http://localhost:8088/amazon/guestbook.jsp" />
 -->
<title>亚马逊 - 留言</title>
<link href="${pageContext.request.contextPath}/css/index.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath}/css/style.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath}/css/adv.css" rel="stylesheet" type="text/css" />
<script src="${pageContext.request.contextPath}/scripts/jquery-2.1.0.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/scripts/adv.js" type="text/javascript"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/function.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/index.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/comment.js"></script>

</head>
<body>
<%@ include file="index_top.jsp"  %>
<div id="position" class="wrap">
	您现在的位置：<a href="${pageContext.request.contextPath}/index.jsp">亚马逊</a> &gt; 在线留言
</div>
<div id="main" class="wrap">
	<div class="lefter">
		<%-- <%@ include file="index_product_sort.jsp" %> --%>
	</div>
	<div class="main">
		<div class="guestbook">
			<h2>全部留言</h2>
			
			<ul>
				<c:forEach items="${pageView.recordList}" var="comments">
				<li>
					<dl>
						<dt>内容：${comments.hc_content}</dt>
						<dd class="author"><span>作者：${comments.hc_nick_name}</span></dd>
						<dd>评论时间：${comments.hc_create_time }</dd>
						<dd>回复：${comments.hc_reply}</dd>
						<dd>回复时间：${comments.hc_reply_time}</dd>
					</dl>
				</li>
				</c:forEach>
			</ul>
			<div class="clear"></div>
			<div class="pager">
				<ul class="clearfix">
				<c:if test="${pageView.recordList.size()!=0}">
				
						<%-- <span>第${pageView.currentPage}/${pageView.recordCount}页${pageView.pageCount}</span> --%>
				<%-- 		<a href="${pageContext.request.contextPath }/AddCommentServlet?pageNow=${pageView.currentPage<2?1:pageView.currentPage-1}">上一页</a>
						
						
						<c:if test="${pageModel.pageCount>=pageModel.currentPage}">
							<a href="${pageContext.request.contextPath }/AddCommentServlet?pageNow=${pageView.currentPage}"> ${pageView.currentPage} </a>
						<c:if test="${pageModel.pageCount>=pageModel.currentPage+1}">
							<a href="${pageContext.request.contextPath }/AddCommentServlet?pageNow=${pageView.currentPage+1}"> ${pageView.currentPage+1} </a>
								<c:if test="${pageModel.pageCount>=pageModel.currentPage+2}">
									<a href="${pageContext.request.contextPath }/AddCommentServlet?pageNow=${pageView.currentPage+2}"> ${pageView.currentPage+2} </a>
									<c:if test="${pageModel.pageCount!=pageModel.currentPage}">
									...
									</c:if>
								</c:if>
						</c:if>
						</c:if>
						
						<a href="${pageContext.request.contextPath }/AddCommentServlet?pageNow=${pageView.currentPage>=pageView.pageCount?pageView.pageCount:pageView.currentPage+1}">下一页</a>
						
				 --%>
					<span>第${pageView.currentPage}/${pageView.pageCount}页</span>
					<a href="${pageContext.request.contextPath }/AddCommentServlet?pageNow=${pageView.currentPage<2?1:pageView.currentPage-1}">上一页</a>
					<c:forEach var="i" begin="1" end="${pageView.pageCount}">
					<a href="${pageContext.request.contextPath }/AddCommentServlet?pageNow=${i}"> ${i} </a>
					</c:forEach>
					<a href="${pageContext.request.contextPath }/AddCommentServlet?pageNow=${pageView.currentPage>=pageView.pageCount?pageView.pageCount:pageView.currentPage+1}">下一页</a>
				</c:if>
				</ul>
			</div>
			<div id="reply-box">
				<form action="${pageContext.request.contextPath }/AddCommentServlet?type=submitInfo" method="post" onsubmit="return commentCheck();">
					<table>
						<tr>
							<td class="field">昵称：</td>
							<td><input class="text" type="text" name="hc_nick_name" /></td>
						</tr>
						<tr>
							<td class="field">留言标题：</td>
							<td><input class="text" type="text" name="hc_id" /></td>
						</tr>
						<tr>
							<td class="field">留言内容：</td>
							<td><textarea name="hc_content"></textarea></td>
						</tr>
						<tr>
							<td>&nbsp;</td>
							<td><label class="ui-blue"><input type="submit" name="submit" value="提交留言" /></label></td>
						</tr>
					</table>
				</form>
			</div>
		</div>
	</div>
	<div class="clear"></div>
</div>
<div id="footer">
	Copyright &copy; 2016 上海海文 All Rights Reserved. 京ICP证1000001号
</div>
</body>
</html>
